package com.koron.css2.serviceManage.mapper;

import com.koron.css2.serviceManage.bean.DistrictBean;
import com.koron.css2.serviceManage.bean.SelectBean;
import com.koron.css2.serviceManage.bean.TreeBean;
import org.apache.ibatis.annotations.Param;
import org.koron.ebs.mybatis.EnvSource;

import java.util.List;

/**
 *  行政区域
 * @author 许海宜
 *
 */
@EnvSource("_default")
public interface DistrictMapper {

	/**
	 * 新增
	 * @param bean
	 * @return
	 */
	public Integer saveDistrict(DistrictBean bean);
	
	/**
	 * 更新
	 * @param bean
	 * @return
	 */
	public Integer updateDistrict(DistrictBean bean);
	
	/**
	 * 查询
	 * @param bean
	 * @return
	 */
	public List<DistrictBean> findDistrict(DistrictBean bean);
	
	/**
	 * 查询省份
	 * @param bean
	 * @return
	 */
	public List<SelectBean> SelectProvince();

	/**
	 * 树结构
	 * @param
	 * @return
	 */
	public List<TreeBean> findDistrictByTree();
	
	/**
	 * 下拉框
	 * @return
	 */
	public List<SelectBean> findDistrictBySelect();
	
	/**
	 * 按ID查询
	 * @param bean
	 * @return
	 */
	public DistrictBean findDistrictById(DistrictBean bean);
	
	/**
	 * 根据id查District数据
	 * @param id
	 * @return
	 */
	public DistrictBean findDistrictById(@Param("id") String id);
	/**
	 * 根据areaName查District数据
	 * @param id
	 * @return
	 */
	public DistrictBean findDistrictByName(@Param("areaName") String areaName);
	
	/**
	 * 根据code查District数据
	 * @param id
	 * @return
	 */
	public SelectBean findDistrictByCode(@Param("code") String code);
	
	/**
	 * 根据某个code下最大子级代号
	 * @param id
	 * @return
	 */
	public String finDistrictxChild(@Param("code") String code);
	
	/**
	 * 根据某个code下最大子级代号
	 * @param id
	 * @return
	 */
	public String findMaxChild(@Param("code") String code);
}
